<html>
<head><meta charset="utf-8"><title>let bindings impl trait removal · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html">let bindings impl trait removal</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="245967947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/245967947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#245967947">(Jul 14 2021 at 14:31)</a>:</h4>
<p>I've just started to remove some things here</p>



<a name="245967990"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/245967990" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#245967990">(Jul 14 2021 at 14:32)</a>:</h4>
<p>wanted to know ... <a href="https://github.com/rust-lang/rust/blob/master/compiler/rustc_hir/src/hir.rs#L2274">https://github.com/rust-lang/rust/blob/master/compiler/rustc_hir/src/hir.rs#L2274</a> seems to be what we using to handle bindings</p>



<a name="245968027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/245968027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#245968027">(Jul 14 2021 at 14:32)</a>:</h4>
<p>but what about <a href="https://github.com/rust-lang/rust/blob/master/compiler/rustc_hir/src/hir.rs#L2277-L2278">https://github.com/rust-lang/rust/blob/master/compiler/rustc_hir/src/hir.rs#L2277-L2278</a> ?</p>



<a name="245968229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/245968229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#245968229">(Jul 14 2021 at 14:33)</a>:</h4>
<p>I think we don't want any of these ...</p>



<a name="245968242"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/245968242" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#245968242">(Jul 14 2021 at 14:33)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">foo</span>: <span class="nc">impl</span><span class="w"> </span><span class="nb">Clone</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="k">static</span><span class="w"> </span><span class="n">foo</span>: <span class="nc">impl</span><span class="w"> </span><span class="nb">Clone</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">2</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="k">const</span><span class="w"> </span><span class="n">foo</span>: <span class="nc">impl</span><span class="w"> </span><span class="nb">Clone</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">3</span><span class="p">;</span><span class="w"></span>
</code></pre></div>



<a name="245968854"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/245968854" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#245968854">(Jul 14 2021 at 14:38)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> looking</p>



<a name="245968871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/245968871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#245968871">(Jul 14 2021 at 14:38)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span> <a href="#narrow/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal/near/245968242">said</a>:</p>
<blockquote>
<p><div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">foo</span>: <span class="nc">impl</span><span class="w"> </span><span class="nb">Clone</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="k">static</span><span class="w"> </span><span class="n">foo</span>: <span class="nc">impl</span><span class="w"> </span><span class="nb">Clone</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">2</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="k">const</span><span class="w"> </span><span class="n">foo</span>: <span class="nc">impl</span><span class="w"> </span><span class="nb">Clone</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">3</span><span class="p">;</span><span class="w"></span>
</code></pre></div><br>
</p>
</blockquote>
<p>this is correct, these are all impl trait in bindings</p>



<a name="245968900"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/245968900" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#245968900">(Jul 14 2021 at 14:38)</a>:</h4>
<p>ok <span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<a name="245968926"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/245968926" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#245968926">(Jul 14 2021 at 14:38)</a>:</h4>
<p>I'm not sure whether this implies we can remove <code>OpaqueTyOrigin::Misc</code> or not</p>



<a name="245968948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/245968948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#245968948">(Jul 14 2021 at 14:39)</a>:</h4>
<p>yeah, I'm not sure right now</p>



<a name="245968954"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/245968954" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#245968954">(Jul 14 2021 at 14:39)</a>:</h4>
<p>probably not</p>



<a name="245968955"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/245968955" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#245968955">(Jul 14 2021 at 14:39)</a>:</h4>
<p>It mentions "bounds", for example-- maybe there are some places that it is used</p>



<a name="245968962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/245968962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#245968962">(Jul 14 2021 at 14:39)</a>:</h4>
<p>right</p>



<a name="245968964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/245968964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#245968964">(Jul 14 2021 at 14:39)</a>:</h4>
<p>but I guss that's just a thing to test</p>



<a name="245968980"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/245968980" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#245968980">(Jul 14 2021 at 14:39)</a>:</h4>
<p>the bounds part :)</p>



<a name="245968998"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/245968998" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#245968998">(Jul 14 2021 at 14:39)</a>:</h4>
<p>yeah, will check that out</p>



<a name="245982493"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/245982493" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#245982493">(Jul 14 2021 at 16:15)</a>:</h4>
<p>was trying to figure out what to do with this test <a href="https://github.com/alexreg/rust/blob/ee890331f6e33afe12ef250eb6388db2aab7cbbf/src/test/ui/associated-type-bounds/lcsit.rs">https://github.com/alexreg/rust/blob/ee890331f6e33afe12ef250eb6388db2aab7cbbf/src/test/ui/associated-type-bounds/lcsit.rs</a></p>



<a name="245982605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/245982605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#245982605">(Jul 14 2021 at 16:16)</a>:</h4>
<p>it was introduced when associated_type_bounds was implemented RFC 2289</p>



<a name="245982613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/245982613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#245982613">(Jul 14 2021 at 16:16)</a>:</h4>
<p>here <a href="https://github.com/rust-lang/rust/issues/57428">#57428</a></p>



<a name="245982653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/245982653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#245982653">(Jul 14 2021 at 16:16)</a>:</h4>
<p>I'm not sure if the test makes sense without let bindings</p>



<a name="245982688"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/245982688" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#245982688">(Jul 14 2021 at 16:17)</a>:</h4>
<p>what's lcsit? :)</p>



<a name="245982826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/245982826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#245982826">(Jul 14 2021 at 16:18)</a>:</h4>
<p>it seems to me that the test should be removed</p>



<a name="245982839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/245982839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#245982839">(Jul 14 2021 at 16:18)</a>:</h4>
<p>but I'm not 100% sure</p>



<a name="245982890"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/245982890" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#245982890">(Jul 14 2021 at 16:18)</a>:</h4>
<p>I agree</p>



<a name="245982975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/245982975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#245982975">(Jul 14 2021 at 16:19)</a>:</h4>
<p>It's probably <code>let const static impl trait</code></p>



<a name="245990186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/245990186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#245990186">(Jul 14 2021 at 17:13)</a>:</h4>
<p>heh there's also a <code>dyn</code> version of that test</p>



<a name="245991771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/245991771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#245991771">(Jul 14 2021 at 17:24)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal/near/245982975">said</a>:</p>
<blockquote>
<p>It's probably <code>let const static impl trait</code></p>
</blockquote>
<p>unsure what you meant here</p>



<a name="245991809"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/245991809" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#245991809">(Jul 14 2021 at 17:24)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116113">lqd</span> <a href="#narrow/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal/near/245990186">said</a>:</p>
<blockquote>
<p>heh there's also a <code>dyn</code> version of that test</p>
</blockquote>
<p>yeah, saw that one too</p>



<a name="245991912"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/245991912" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#245991912">(Jul 14 2021 at 17:25)</a>:</h4>
<p>lcsit being an acronym for Let Const Static Impl Trait , the "3 kinds of let bindings impl trait", just like you said before</p>



<a name="245994882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/245994882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#245994882">(Jul 14 2021 at 17:47)</a>:</h4>
<p>ohhh <span aria-label="joy" class="emoji emoji-1f602" role="img" title="joy">:joy:</span></p>



<a name="246012543"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/246012543" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#246012543">(Jul 14 2021 at 20:03)</a>:</h4>
<p>for this example ...</p>



<a name="246012634"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/246012634" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#246012634">(Jul 14 2021 at 20:04)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="c1">// edition:2018</span>

<span class="k">use</span><span class="w"> </span><span class="n">std</span>::<span class="n">io</span>::<span class="n">Error</span><span class="p">;</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">make_unit</span><span class="p">()</span><span class="w"> </span>-&gt; <span class="nb">Result</span><span class="o">&lt;</span><span class="p">(),</span><span class="w"> </span><span class="n">Error</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="nb">Ok</span><span class="p">(())</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">fut</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">async</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="n">make_unit</span><span class="p">()</span><span class="o">?</span><span class="p">;</span><span class="w"></span>

<span class="w">        </span><span class="nb">Ok</span><span class="p">(())</span><span class="w"> </span><span class="c1">//~ ERROR type annotations needed</span>
<span class="w">    </span><span class="p">};</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="246012673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/246012673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#246012673">(Jul 14 2021 at 20:04)</a>:</h4>
<p>what would we prefer of the following ...</p>



<a name="246012693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/let%20bindings%20impl%20trait%20removal/near/246012693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/let.20bindings.20impl.20trait.20removal.html#246012693">(Jul 14 2021 at 20:04)</a>:</h4>
<div class="codehilite"><pre><span></span><code>diff --git a/src/test/ui/inference/cannot-infer-async.stderr b/src/test/ui/inference/cannot-infer-async.stderr
index 23360483361..5c6640b0c78 100644
--- a/src/test/ui/inference/cannot-infer-async.stderr
+++ b/src/test/ui/inference/cannot-infer-async.stderr
@@ -1,8 +1,8 @@
-error[E0282]: type annotations needed
+error[E0282]: type annotations needed for `impl Future`
   --&gt; $DIR/cannot-infer-async.rs:13:9
    |
 LL |     let fut = async {
-   |         --- consider giving `fut` a type
+   |         --- consider giving `fut` the explicit type `impl Future`, where the type parameter `E` is specified
 ...
 LL |         Ok(())
    |         ^^ cannot infer type for type parameter `E` declared on the enum `Result`
</code></pre></div>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>